<template>
  <!--Order{id=1,  orderCreateTime='12312', userName='zc', orderAccount=350.0, orderPhone='13588155927', userAccount=null, payMethod='null', cinemaShowCode=null, preferenceLevel=null}-->
  <div class="app-container">
    <el-form :inline="true" :model="formdata" ref="formdata" class="box01">
      <el-form-item label="账号:" prop="orderPhone">
        <el-input v-model="formdata.orderPhone" placeholder="请输入账号"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="select(formdata.orderPhone)">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="Mo" border fit highlight-current-row>
      <el-table-column align="center" label="订单编号" prop="orderCode" width="110">
        <template slot-scope="scope">
          {{ scope.row.orderCode }}
        </template>
      </el-table-column>
      <el-table-column label="创建时间" prop="orderCreateTime" width="110" align="center">
        <template slot-scope="scope">
          {{ scope.row.orderCreateTime}}
        </template>
      </el-table-column>
      <el-table-column label="购买人真实姓名"  prop="userName" width="110" align="center">
        <template slot-scope="scope">
          {{ scope.row.userName }}
        </template>
      </el-table-column>
      <el-table-column label="订单总额"  prop="orderAccount" width="110" align="center">
        <template slot-scope="scope">
          {{ scope.row.orderAccount}}
        </template>
      </el-table-column>
      <el-table-column  label="用户账号"  prop="orderPhone" width="110" align="center">
        <template slot-scope="scope">
          {{ scope.row.orderPhone}}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
    export default {
        data() {
            return {
                Mo: [{
                    orderCode:"",
                    orderCreateTime: "",
                    userName:"" ,
                    orderAccount:"",
                    orderPhone:""
                }],
                formdata: {
                    orderphone: ''
                }
            }
        },
        methods: {
            select(formdata){
                console.log(formdata)
                var vm = this
                this.axios({
                    url: 'http://localhost:81/api/user/order',
                    params:{orderPhone:formdata}
                }).then(function(res){
                    if (res.data.success) {
                        vm.Mo = res.data.data
                        console.log("====="+vm.Mo)
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>
